with open('/Users/lx/files/git/prac/python_work/ch10/pi_digits.txt') as file_object:
    contents = file_object.read()
    print(contents)

with open('/Users/lx/files/git/prac/python_work/ch10/pi_digits.txt') as file_object:
    print('****print lines****')
    for line in file_object:
        print(line.strip())

with open('/Users/lx/files/git/prac/python_work/ch10/pi_digits.txt') as file_object:
    lines = file_object.readlines()


print('****print lines out the with****')
for line in lines:
    print(line.strip())


print('****use file content****')
pi_string = ''
for line in lines:
    pi_string += line.strip()

print(pi_string)